package com.aiti.lulian.controller;

import com.aiti.base.core.utils.message.Message;
import com.aiti.lulian.annotates.LoginUser;
import com.aiti.lulian.bo.LoginUserInfo;
import com.aiti.lulian.dto.industry.StarEnterpriseParamDto;
import com.aiti.lulian.dto.industry.StarEnterpriseQueryDto;
import com.aiti.lulian.service.CardGovIndustryStarEnterpriseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @description: IndustryStartInterpriseController
 * @auth fcb
 * @date 2025-03-06 16:31
 **/
@RestController
@RequestMapping("/industry/starEnterprise")
@Api(tags = "特色产业--明星企业")
public class IndustryStarEnterpriseController {

    @Autowired
    private CardGovIndustryStarEnterpriseService cardGovIndustryStarEnterpriseService;

    @ApiOperation(value = "新增明星企业")
    @PostMapping("/add")
    public Message addStartEnterprise(@Validated @RequestBody StarEnterpriseParamDto paramDto, @LoginUser LoginUserInfo loginUserInfo) {
        cardGovIndustryStarEnterpriseService.addStartEnterprise(paramDto, loginUserInfo);
        return Message.success();
    }

    @ApiOperation(value = "修改明星企业")
    @PostMapping("/update")
    public Message updateStartEnterprise(@RequestBody StarEnterpriseParamDto paramDto, @LoginUser LoginUserInfo loginUserInfo) {
        cardGovIndustryStarEnterpriseService.updateStartEnterprise(paramDto, loginUserInfo);
        return Message.success();
    }

    @ApiOperation(value = "删除明星企业")
    @PostMapping("/delete")
    public Message deleteStartEnterprise(@RequestBody List<String> baseIds) {
        cardGovIndustryStarEnterpriseService.deleteStartEnterprise(baseIds);
        return Message.success();
    }

    @ApiOperation(value = "明星企业详情")
    @GetMapping("/detail")
    public Message getStarEnterpriseDetail(@RequestParam("baseId") String baseId) {
        return Message.success(cardGovIndustryStarEnterpriseService.getStarEnterpriseDetail(baseId));
    }

    @ApiOperation(value = "明星企业列表")
    @PostMapping("/list")
    public Message getStarEnterpriseList(@RequestBody StarEnterpriseQueryDto paramDto) {
        return Message.success(cardGovIndustryStarEnterpriseService.queryIndustryStarEnterpriseList(paramDto));
    }

}
